# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=rygel
pkgver=0.34.0
pkgrel=1
pkgdesc="UPnP AV MediaServer and MediaRenderer that allows you to easily share audio, video and pictures, and control of media player on your home network"
url="https://wiki.gnome.org/Projects/Rygel"
arch=(i686 x86_64)
license=(LGPL)
depends=(gupnp-av gupnp-dlna libgee gtk3 libunistring libtracker-sparql libmediaart)
makedepends=(vala intltool python2 gobject-introspection git valadoc)
optdepends=('gst-plugins-base: Extra media codecs'
            'gst-plugins-good: Extra media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'
            'gst-libav: Extra media codecs'
            'tracker: Share indexed media files')
backup=(etc/rygel.conf)
groups=(gnome-extra)
_commit=a1028cf87bba148dd6664a0682f7a8dee8cf7762  # tags/RYGEL_0_34_0^0
source=("git+https://git.gnome.org/browse/rygel#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^RYGEL_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib \
              --disable-static --enable-mediathek-plugin --enable-gst-launch-plugin \
              --enable-apidocs
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
